<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="format-detection" content="telephone=no">
    <meta name="author" content="得闲技术 Team">
    <meta name="copyright" content="得闲技术">
    <title>账户设置 - Powered By 得闲技术</title>
    [#include "/admin/main/resources/list.ftl"/]
</head>
<body class="admin secondary">
<main>
    <div class="container-fluid">
        <form id="saveOrUpdateForm" class="ajax-form form-horizontal" action="update" method="post">
            <div class="panel panel-default">
                <div class="panel-heading">账户设置</div>
                <div class="panel-body padding-5">

                    <ul class="nav nav-tabs">
                        <li class="active">
                            <a href="#basic" data-toggle="tab">基本信息</a>
                        </li>
                    </ul>
                    <div class="tab-content">
                        <div id="basic" class="tab-pane active">

                            <div class="form-group">
                                <label class="col-xs-3 col-sm-2 control-label item-required" for="gender">性别:</label>
                                <div class="col-xs-9 col-sm-4">
                                    <select name="gender" id="gender" class="selectpicker form-control" required="required">
                                        [#list gender as g]
                                            <option value="${g}" [#if admin.gender==g]selected="selected"[/#if]>
                                                ${message("GenderEnum." + g)}
                                            </option>
                                        [/#list]
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-xs-3 col-sm-2 control-label" for="avatar">头像:</label>
                                <div class="col-xs-9 col-sm-4">
                                    [#if admin.avatar??]
                                        <input id="avatar" name="avatar" type="hidden" data-image-url="${imageHost}${admin.avatar!}"
                                                value="${admin.avatar!}" data-provide="fileinput" data-file-type="IMAGE" maxlength="500">
                                    [#else]
                                        <input id="avatar" name="avatar" type="hidden" data-image-url=""
                                                value="${admin.avatar!}" data-provide="fileinput" data-file-type="IMAGE" maxlength="500">
                                    [/#if]
                                </div>
                            </div>

                        </div>
                    </div>
                </div>
                <div class="panel-footer">
                    <div class="row">
                        <div class="col-xs-9 col-sm-10 col-xs-offset-3 col-sm-offset-2">
                            <button class="btn btn-primary" type="submit">确 定</button>
                            <button class="btn btn-default" type="button" data-action="back">返 回</button>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
</main>
<script>
    $().ready(function () {

        var $saveOrUpdateForm = $("#saveOrUpdateForm");

        // 表单验证
        $saveOrUpdateForm.validate({
            rules: {
            },
            messages: {
            },
            submitHandler: function (form) {
                $(form).ajaxSubmit({
                    successRedirectUrl: "modify_password"
                });
            }
        });
    });
</script>
</body>
</html>
